﻿#--------------------------------------------------------------------------------------------------------------------------------------------------------
#
# Mi-DevEnv			:	http://midevenv.codeplex.com 
#					:	(c) IT Bridge 2012
#					:	A concept originated by Chris Nurse
#
# Licence			:	GNU General Public License version 2 (GPLv2)
#					:	http://midevenv.codeplex.com/license
#
# Summary           :   Install SharePoint 2010
#
#--------------------------------------------------------------------------------------------------------------------------------------------------------

Set-StrictMode -Version Latest

if ((Get-Module MDE-Common) -eq $null) {
    Import-Module MDE-Common
    }

[string]$executionPath = Split-Path $script:MyInvocation.MyCommand.Path -Parent
[string]$package = "SP2010"
[string]$packageDescription = "SharePoint 2010"
[bool]$needDC = $true
[bool]$needWebServer = $true
[bool]$serverBuild = $false
[int]$installPriority=61000
[string]$CheckFile = "C:\Invalid.File"

Function InstallProduct() {

    try {
    
        if (Get-RunInstallation -Package $package -CheckFile $CheckFile -RequireDC $needDC -RequireIIS $needWebServer) {

    #region Package-Specific
    
            Set-LowRiskFileTypes ".exe;.ps1;.bat;.vbs;"
            Add-ServiceAccounts -Product SharePoint

l $scriptDir -Force

            Write-Host Install SharePoint 2010
            Write-Host -----------------------
            Write-Host

            cd $scriptDir
            $scriptDir = "MDE_AUTOSP2010_FOLDER"

            copy $executionPath\AutoSP_Config_2010.xml $scriptDir -Force
            copy $executionPath\AutoSP_Config-OWA_2010.xml $scriptDir -Force
            copy $executionPath\AutoSP_InstallerInput_2010.xm

            & .\AutoSP_InstallerLaunch.bat

    #endregion
 
            Write-Progress "PROCESS COMPLETE : Install $package"
            }
        }
    catch {
        LogException($_, $package, $interactive)
        }
    }

#region Metadata

Function GetPackageName() {
    return $package
    }

Function GetPackageDescription() {
    return $packageDescription
    }
    
Function GetServerBuild() {
    return $serverBuild 
    }
        
Function GetInstallPriority() {
    return $InstallPriority
    }

#endregion
